home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
bipl.zip
/
PROGS.ZIP
/
CRYPT.ICN
< prev
next >
Wrap
Text File
|
1992-09-28
|
1KB
|
43 lines
############################################################################
#
# File: crypt.icn
#
# Subject: Program to encript file
#
# Author: Phil Bewig
#
# Date: May 5, 1992
#
###########################################################################
#
# Do *not* use this in the face of competent cryptanalysis.
#
# usage: [iconx] icrypt [key] <infile >outfile
#
############################################################################
#
# As written, uses UNIX-style console I/O.
#
############################################################################
procedure main(args)
local i, k, ky, l, con
if *args = 1 then
ky := get(args)
else {
con := open("/dev/tty", "b")
writes(con, "Enter password: ")
# NOTE: displays password!
ky := read(con)
close(con) }
i := 1
l := 0
k := []
every put(k, ord(!ky)) do
l +:= 1
while writes(char(ixor(ord(reads()), k[i]))) do
i %:= l + 1
end